{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# scikit-learn中的逻辑回归.ipynb"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 逻辑回归中使用正则化\n",
    "![逻辑回归中使用正则化](images/逻辑回归中使用正则化.png)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.random.seed(666)\n",
    "X = np.random.normal(0, 1, size=(200, 2)) # 生成均值为0，方差为1的200行2列的数据\n",
    "y = np.array(X[:, 0]**2 + X[:, 1] < 1.5, dtype='int')  # 表达式的值小于1.5时为True(可以看做0)，大于等于1.5时看做1\n",
    "for _ in range(20):\n",
    "    y[np.random.randint(200)] = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3df4xe1Xkn8O/jYRxeSOPBZbSJx6ZGWuQ0axwsJmxX0N3GppiUAMZt3SZVfyjZuFETEZKuY5NIYFhV2EEbd9mmal1ASbVJm1lhzI8swgRSZbFKknGAAQKUqIj4R7QZAnYCzMZj+9k/7rz2+75zzr3n3Hvuj/O+349kwdx5594z78w899znnPMcUVUQEVG8FtTdACIiKoaBnIgocgzkRESRYyAnIoocAzkRUeTOqOOi5557ri5fvryOSxMRRWv//v2vqupo7/FaAvny5csxOTlZx6WJiKIlIq+YjjO1QkQUOQZyIqLIMZATEUWOgZyIKHI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78wCABOqemstbennQE5ENAj6OrVCRDQIGMiJiCLHQE5EFDkGciKiyDGQExFFjoGciChyDORERJH7/+IB0gDg+aeOAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用sklearn中的库来解决上面的逻辑回归问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=666)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "                   intercept_scaling=1, l1_ratio=None, max_iter=100,\n",
       "                   multi_class='warn', n_jobs=None, penalty='l2',\n",
       "                   random_state=None, solver='warn', tol=0.0001, verbose=0,\n",
       "                   warm_start=False)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "log_reg = LogisticRegression()\n",
    "log_reg.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7933333333333333"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "log_reg.score(X_train, y_train) # LogisticRegression默认地是用得线性模拟地，所以效果不好，下面会用多项式来解决"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.86"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "log_reg.score(X_test, y_test) # 测试数据集也不一般"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_decision_boundary(model, axis):\n",
    "    \"\"\"\n",
    "    根据模型绘制决策边界\n",
    "    \"\"\"\n",
    "    x0, x1 = np.meshgrid(\n",
    "        np.linspace(axis[0], axis[1], int((axis[1]-axis[0])*100)).reshape(-1, 1),\n",
    "        np.linspace(axis[2], axis[3], int((axis[3]-axis[2])*100)).reshape(-1, 1),\n",
    "    )\n",
    "    X_new = np.c_[x0.ravel(), x1.ravel()]\n",
    "\n",
    "    y_predict = model.predict(X_new)\n",
    "    zz = y_predict.reshape(x0.shape)\n",
    "\n",
    "    from matplotlib.colors import ListedColormap\n",
    "    custom_cmap = ListedColormap(['#EF9A9A','#FFF59D','#90CAF9'])\n",
    "    \n",
    "    plt.contourf(x0, x1, zz, linewidth=5, cmap=custom_cmap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:17: UserWarning: The following kwargs were not used by contour: 'linewidth'\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly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AUtlVVf6Sq5Zkvf47qnoLUUdWDqnoo6XYYXA7geVV9QVVPA7gPwHUJt6mJqv4UwPGk2+FHVSdU9amZvxdRDUj9ybaqmVa9MfNlfuZP6n7HRWQAwDUA7gny/MQCe205gqTaEJSIbBOR3wD4INI5Yq/1YQA7k25EB+oH8Juar8eQwkDUiUTkAgDrAPwi2Za4m0lx7ANwFMAuVU1jO/8G1UFwJciTI9WK8ROkHEGc7x+UVztV9QeqOgxgWERuA3ATgM+2tYHwb+PMc4ZRvQW+t51tqxWknSnlVuwodSO3TiMibwHwXQAfa7j7TQ1VnQawdmZu6nsicrGqpmYOQ0TeB+Coqj4pIlcEeU2sgb1TyhGY2uni/wB4EAkEdr82isiHALwPwB9ogpsTQnwv02YMwPk1Xw8AeCmhtmSCiORRDer3quq/JN0eP6p6QkT2oDqHkZrADmAIwLUicjWAXgBnich3VPUG0wsSScWo6rOqeq6qXqCqF6D6S/WuNNaYEZF31Hx5LYBfJdUWExHZBOCTAK5V1VNJt6dD/RLAO0TkbSLSA+B6AA8k3KaOJdUR2zcAHFTVO5Nuj4mILHVWkYlIAcAGpOx3XFVvU9WBmVh5PYBHvII6kPzkaSe4Q0QOiMgzqKaO0rhs66sA+gDsmlmW+XdJN8iNiPyhiIwB+D0AD4rIw0m3yTEz+XwTgIdRnei7X1VHk21VMxH5JwA/A7BSRMZE5C+SbpPBEIA/A7B+5v/kvpkRZ9osB/Djmd/vX6KaY/ddTph2LClARJQxHLETEWUMAzsRUcYwsBMRZQwDOxFRxjCwExFlDAM7EVHGMLATEWXM/wfJvNGYiwMXEAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(log_reg, axis=[-4, 4, -4, 4])\n",
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show() # 可以看到效果一般"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 引入多项式项"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 为逻辑回归添加多项式项的管道\n",
    "from sklearn.pipeline import Pipeline\n",
    "from sklearn.preprocessing import PolynomialFeatures\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "def PolynomialLogisticRegression(degree):\n",
    "    return Pipeline([\n",
    "        ('poly', PolynomialFeatures(degree)), # 把高次幂转换为线性方程\n",
    "        ('std_scaler', StandardScaler()),\n",
    "        ('log_reg', LogisticRegression()) # 这里直接用地sklearn自带的逻辑回归方程了\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "         steps=[('poly',\n",
       "                 PolynomialFeatures(degree=2, include_bias=True,\n",
       "                                    interaction_only=False, order='C')),\n",
       "                ('std_scaler',\n",
       "                 StandardScaler(copy=True, with_mean=True, with_std=True)),\n",
       "                ('log_reg',\n",
       "                 LogisticRegression(C=1.0, class_weight=None, dual=False,\n",
       "                                    fit_intercept=True, intercept_scaling=1,\n",
       "                                    l1_ratio=None, max_iter=100,\n",
       "                                    multi_class='warn', n_jobs=None,\n",
       "                                    penalty='l2', random_state=None,\n",
       "                                    solver='warn', tol=0.0001, verbose=0,\n",
       "                                    warm_start=False))],\n",
       "         verbose=False)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg = PolynomialLogisticRegression(degree=2)\n",
    "poly_log_reg.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9133333333333333"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.score(X_train, y_train) # 正确率明显提高"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.94"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.score(X_test, y_test) # 正确率也明显提高"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:17: UserWarning: The following kwargs were not used by contour: 'linewidth'\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3df5Bc1XUn8O+Z7hbTkgdJY0mrYQaQMZYWJIxkCOvU2GXMCiwJB1cSJSGBRIvXpbJZfqSICxtr107IKusfVcSAY3sVHKwtk7BEjm3WSGCpMDYotjE/BNIgS4XZIGsYVsL61ZZmoHv67B89b9Q/3n3vvh/d/fr191OlKk1Pz+s70sx5t88991xRVRARUXr0tHsAREQULwZ2IqKUYWAnIkoZBnYiopRhYCciShkGdiKilIktsItIRkSeF5Hvx3VNIiIKLs4Z+60A9sZ4PSIiCiGWwC4iQwCuBnBfHNcjIqLwsjFd58sAbgfQZ3qCiKwHsB4AZp1xxiXvWrgwppcmIuoOu1599Q1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3MGoaIfBjAIVV9VkQut/mapgb2TmlHYBqni38E8AjaENj9xigi6wB8GJWmbG0LSAH+LZPmIICzqz4eAvBam8aSCiKSQyWoP6Cq/9Lu8fhR1WMi8gQqaxiJCewAhgFcIyJrAPQCOFNEvqWq15u+oC2pGFXdraoLVHWRqi5C5ZfqPUnsMSMi76r68BoAv2jXWExEZBWATwG4RlVPtXs8HernAN4lIu8QkRkArgXwcJvH1LGkMmP7BoC9qnpXu8djIiLznSoyEckDWImE/Y6r6h2qOjQVK68F8LhXUAfav3jaCT4vIntE5EVUUkdJLNv6CoA+ANunyjK/3u4BuRGR3xWRgwB+G8AjIvJYu8fkmFp8vgnAY6gs9D2kqiPtHVUjEfknAD8BsEREDorIf273mAyGAfwpgCumfiZ3Tc04k2YAwA+nfr9/jkqO3becMOnYUoCIKGU4YyciShkGdiKilGFgJyJKGQZ2IqKUYWAnIkoZBnYiopRhYCciSpn/D1XfSICIg2ChAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(poly_log_reg, axis=[-4, 4, -4, 4])\n",
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show() # 引入多项式后，可以看到决策边界明显准确多了"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 提高degree看看决策边界的变化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "         steps=[('poly',\n",
       "                 PolynomialFeatures(degree=20, include_bias=True,\n",
       "                                    interaction_only=False, order='C')),\n",
       "                ('std_scaler',\n",
       "                 StandardScaler(copy=True, with_mean=True, with_std=True)),\n",
       "                ('log_reg',\n",
       "                 LogisticRegression(C=1.0, class_weight=None, dual=False,\n",
       "                                    fit_intercept=True, intercept_scaling=1,\n",
       "                                    l1_ratio=None, max_iter=100,\n",
       "                                    multi_class='warn', n_jobs=None,\n",
       "                                    penalty='l2', random_state=None,\n",
       "                                    solver='warn', tol=0.0001, verbose=0,\n",
       "                                    warm_start=False))],\n",
       "         verbose=False)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg = PolynomialLogisticRegression(degree=20) # 多项式阶数传入地越高，决策边界越不规则\n",
    "poly_log_reg.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.94"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.score(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.92"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.score(X_test, y_test) # 测试集表现查了，可以提高degree并不一定是好地"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:17: UserWarning: The following kwargs were not used by contour: 'linewidth'\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/A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rZKgtgZU8TlWOw8t05DRM4G8B0Af1kz+40NqjoFYHhmbeq7IrJMVWOzhiEi7wdwWFWfEpErg7ymqcLeKe0ITHa68G0AD6ANwu5no4isB/B+lJqytU2QQnyWceMQgAsqHg8BeLlNtiQCEcmgJOr3qOq/tNseP1R1UkQeR2kNIzbCDmAEwHUishpAL4BzRORuVTX2A29LKEZV96nq+ap6oapeiNKP6u1x7DEjIm+peHgdgJ+3yxYTIrIKwCcAXKeqJ9ttT4fyMwBvEZE3i8gsANcDuL/NNnUsUvLYvglgv6re1m57TIjIfCeLTESyAFYgZr9xVf2Uqg7NaOX1AB71EnWg/YunncCtIvKciDyLUugojmlbXwHQB2DXTFrm19ttkBsi8rsicgjAOwE8ICIPt9smh5nF5xsBPIzSQt99qjrWXqvqEZF/AvB/ASwWkUMi8uF222RgBMCfALhq5js5OuNxxo0BAI/N/L5/hlKM3TedMO6wpQAhhCQMeuyEEJIwKOyEEJIwKOyEEJIwKOyEEJIwKOyEEJIwKOyEEJIwKOyEEJIw/j8zChsYnNulNQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(poly_log_reg, axis=[-4, 4, -4, 4])\n",
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show() # 可以看到当degree后，决策边界变地有些乱了，这其实是过拟合的一种表现"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 通过L1正则项C来调整模型\n",
    "> C是起到模型正则化的作用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "def PolynomialLogisticRegression(degree, C):\n",
    "    return Pipeline([\n",
    "        ('poly', PolynomialFeatures(degree)), # 把高次幂转换为线性方程\n",
    "        ('std_scaler', StandardScaler()),\n",
    "        ('log_reg', LogisticRegression(C=C)) # 这里直接用地sklearn自带的逻辑回归方程了\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "         steps=[('poly',\n",
       "                 PolynomialFeatures(degree=20, include_bias=True,\n",
       "                                    interaction_only=False, order='C')),\n",
       "                ('std_scaler',\n",
       "                 StandardScaler(copy=True, with_mean=True, with_std=True)),\n",
       "                ('log_reg',\n",
       "                 LogisticRegression(C=0.1, class_weight=None, dual=False,\n",
       "                                    fit_intercept=True, intercept_scaling=1,\n",
       "                                    l1_ratio=None, max_iter=100,\n",
       "                                    multi_class='warn', n_jobs=None,\n",
       "                                    penalty='l2', random_state=None,\n",
       "                                    solver='warn', tol=0.0001, verbose=0,\n",
       "                                    warm_start=False))],\n",
       "         verbose=False)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg = PolynomialLogisticRegression(degree=20, C=0.1)\n",
    "poly_log_reg.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8533333333333334"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.score(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.92"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.score(X_test, y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:17: UserWarning: The following kwargs were not used by contour: 'linewidth'\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO2de5Bc9XXnv2e6W0xLDIwEIhpmkDHBYoWEGVkOm9SYMmYlLIQLV2LFSyISrR2XymYRSkjWL2XxmpTiB1vEgGN7FRysLXBYR45j1ghsqTA2qOIHNhJoLEuF2YA1DCWBEDRoxuqeOftHzx314/7u83e7b9/+fqoo1Hdu3z490/39nXt+5yGqCkIIIdmhp90GEEIIsQuFnRBCMgaFnRBCMgaFnRBCMgaFnRBCMgaFnRBCMoY1YReRnIg8KSLfsXVNQggh4bHpsW8GcMDi9QghhETAirCLyBCAawDcbeN6hBBCopO3dJ0vAPgogD7TCSKyEcBGAJh32mkr37JokaWXJoSQ7mDvc8+9pKoL/c6LLewi8h4AR1T1ZyJyhek8Vd0GYBsArDj/fP3+li1xX5oQQrqK+Rs3PhfkPBuhmBEA14rIvwO4H8CVInKvhesSQgiJQGxhV9VPqOqQqp4P4DoAj6jq9bEtI4QQEgnmsRNCSMawtXkKAFDVRwE8avOahBBCwkGPnRBCMgaFnRBCMgaFnRBCMgaFnRBCMgaFnRBCMgaFnRBCMgaFnRBCMgaFnRBCMobVAqVOZWepiLuO9eHFSg6L8lPYtKCEtX0T7TaLEEIi0fXCvrNUxK1Hz8SkVm9exit53Hr0TACguBNCOpKuD8XcdaxvVtQdJrUHdx0ztpYnhJBU0/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ey0fBPBQu43oQAYB/Lrm8WGkUIg6ERE5H8AKAD9uryXuzIQ49gI4AmCXqqbRzi+g6gRPBzk50X7sQdoRJPn6QfGyU1W/rapbAGwRkU8AuBHAp1pqIPxtnDlnC6q3wPe10rZagtiZUsTlWOo8t05DRE4H8E0Af95w95saVHUKwPDM3tS3RGS5qqZmD0NE3gPgiKr+TESuCPKcRIW9U9oRmOx04esAHkQbhN3PRhHZAOA9qDZla5sghfhdpo3DAM6reTwE4IU22ZIJRKSAqqjfp6r/0m57/FDV4yLyKKp7GKkRdgAjAK4VkbUAegGcISL3qqqxp3ZbQjGq+rSqnqOq56vq+ah+qd6Wxh4zIvKWmofXAvhlu2wxISJrAHwMwLWqeqLd9nQoPwXwFhF5s4jMAXAdgAfabFPHIlWP7asADqjq7e22x4SILHSyyESkCGAVUvYdV9VPqOrQjFZeB+ARL1EH2r952gl8VkT2i8hTqIaO0pi29UUAfQB2zaRlfqXdBrkhIr8vIocB/B6AB0Xku+22yWFm8/lGAN9FdaPvG6o62l6rmhGRfwLwbwAuEpHDIvJn7bbJwAiAPwFw5cxncu+Mx5k2BgB8f+b7/VNUY+y+6YRphy0FCCEkY9BjJ4SQjEFhJ4SQjEFhJ4SQjEFhJ4SQjEFhJ4SQjEFhJ4SQjEFhJ4SQjPH/AUHX6C0f2fynAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(poly_log_reg, axis=[-4, 4, -4, 4])\n",
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show() # 可以看到当degree后，决策边界变地有些乱了，这其实是过拟合的一种表现"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 通过L2正则项`penalty`来调整模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "def PolynomialLogisticRegression(degree, C, penalty='12'):\n",
    "    return Pipeline([\n",
    "        ('poly', PolynomialFeatures(degree)), # 把高次幂转换为线性方程\n",
    "        ('std_scaler', StandardScaler()),\n",
    "        ('log_reg', LogisticRegression(C=C, penalty=penalty)) # 这里直接用地sklearn自带的逻辑回归方程了\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "poly_log_reg = PolynomialLogisticRegression(degree=20, C=0.1, penalty='l1')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "         steps=[('poly',\n",
       "                 PolynomialFeatures(degree=20, include_bias=True,\n",
       "                                    interaction_only=False, order='C')),\n",
       "                ('std_scaler',\n",
       "                 StandardScaler(copy=True, with_mean=True, with_std=True)),\n",
       "                ('log_reg',\n",
       "                 LogisticRegression(C=0.1, class_weight=None, dual=False,\n",
       "                                    fit_intercept=True, intercept_scaling=1,\n",
       "                                    l1_ratio=None, max_iter=100,\n",
       "                                    multi_class='warn', n_jobs=None,\n",
       "                                    penalty='l1', random_state=None,\n",
       "                                    solver='warn', tol=0.0001, verbose=0,\n",
       "                                    warm_start=False))],\n",
       "         verbose=False)"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8266666666666667"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.score(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.score(X_test, y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:17: UserWarning: The following kwargs were not used by contour: 'linewidth'\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO2de5Bc9XXnv2d6ephGGTMSiJWYAcsESwsSZgSETWrsMlYEFsLBlUTJkhWJFselWrM8ssTl16TwmqxiO94iBhzbq+BgUiZhiRzHrBHYUmFsUK0fYCTQWJYKs0HWMJSExaMt9aDumbN/9NzR7e77u8/f7b595/upUpX6zu3fPa1Rf++553ceoqoghBCSH3o6bQAhhBC7UNgJISRnUNgJISRnUNgJISRnUNgJISRnUNgJISRnWBN2ESmIyDMi8i1baxJCCImOTY/9FgD7LK5HCCEkBlaEXUSGAVwN4B4b6xFCCIlPr6V1Pg/gIwAGTCeIyGYAmwFgwSmnXPL2JUssXZoQQuYHu1988RVVXRx0XmJhF5H3ATisqk+LyOWm81R1K4CtALB62TL97thY0ksTQsi8YuHmzS+GOc9GKGYUwDUi8m8AHgCwRkS+ZmFdQgghMUgs7Kr6cVUdVtVlAK4F8JiqXpfYMkIIIbFgHjshh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4IJVd3TKRvCIiJbROQXADYimx67mw8AeKTTRnQhQwB+4Xp9CBkUom5ERJYBWA3gh521xJvZEMduAIcB7FDVLNr5edSd4JkwJ8cuUApDmHYEaV4/LH52quo3VXUMwJiIfBzAjQA+2VYDEWzj7DljqD8C399O29yEsTOjiMexzHlu3YaI/BqArwP4s6an38ygqtMARmb3pr4hIqtUNTN7GCLyPgCHVfVpEbk8zHtSFfZuaUdgstODfwTwMDog7EE2isgmAO9DvSlbxwQpwr9l1jgE4GzX62EAL3XIllwgIkXURf1+Vf2XTtsThKq+JiKPo76HkRlhBzAK4BoRWQ+gH8BbRORrqmqc4NORUIyqPqeqZ6rqMlVdhvqX6uIs9pgRkbe7Xl4D4GedssWEiKwD8FEA16jq8U7b06X8GMDbReRtItIH4FoAD3XYpq5F6h7bVwDsU9U7Om2PCRFZ7GSRiUgJwFpk7Duuqh9X1eFZrbwWwGN+og50fvO0G/iMiOwVkWdRDx1lMW3rCwAGAOyYTcv8cqcN8kJEfldEDgH4LQAPi8i3O22Tw+zm840Avo36Rt+DqjreWataEZF/AvB/AawQkUMi8qedtsnAKIA/BrBm9v/k7lmPM2ssBfDd2e/3j1GPsQemE2YdthQghJCcQY+dEEJyBoWdEEJyBoWdEEJyBoWdEEJyBoWdEEJyBoWdEEJyBoWdEEJyxv8HCnmNFAS8L/MAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(poly_log_reg, axis=[-4, 4, -4, 4])\n",
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show() # 可以看到当degree后，决策边界变地有些乱了，这其实是过拟合的一种表现"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### degres、C和penalty都是超参数，找到最合适的系数需要进行网格搜索"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
